home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
zbpc_460.zip
/
DEMOS.EXE
/
DAYOFWK.BAS
next >
Wrap
BASIC Source File
|
1991-04-10
|
640b
|
19 lines
' DAY-WK = Calculates the day of the week given date
DIM Days$(6): FOR I=0 TO 6: READ Days$(I): NEXT
CLS :PRINT
PRINT" This routine calculates the day of the week given the date" : PRINT
INPUT "Enter date as dd/mm/yyyy ";Date$
X$ = LEFT$(Date$,2) : Month = VAL(X$)
X$ = MID$(Date$,4,2) : Day = VAL(X$)
X$ = RIGHT$(Date$,4) : Year = VAL(X$)
IF Month > 2 GOTO "Bypass"
Month=Month+12 : Year=Year-1
"Bypass"
N=Day+2*Month+INT(.6*(Month+1))+Year+INT(Year/4)-INT(Year/100)+INT(Year/400)+ 2
N=INT((N/7-INT(N/7))*7+.5)
PRINT Days$(N)
DATA Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday